<%@taglib prefix="s" uri="/struts-tags"%>

<s:form action="/person" method="post" theme="bootstrap" cssClass="form-horizontal" id="personform">
	<s:textfield name="firstName" label="First Name" required="true" />
	<s:textfield name="middleName" label="Middle Name" />
	<s:textfield name="lastName" label="Last Name" />
	<div class="control-group">
		<label class="control-label" for="#_birth">Birthdate</label>
		<div class="controls">
			<input name="birthdate" placeholder="yyyy-mm-dd" data-datepicker="datepicker" class="small" type="text" id="#_birth" />
		</div>
	</div>
	<s:radio name="male" list="#{'true' : 'Male', 'false' : 'Female'}" value="true" label="Gender" />
	<s:textarea name="address" label="Address" cols="30" rows="4"></s:textarea>
	<div class="form-actions">
		<button value="Save" class="btn btn-primary">Save</button>
		<input type="reset" class="btn" />
	</div>
</s:form>

<script type="text/javascript">
	$(function() {
		$('input[name="birthdate"]').datepicker();
		
		$('#personform').ajaxForm({
			target : "#form",
			success : function(data) {
				$('#list').load('<s:url value="/person" />');
			}
		});
	});
</script>